const express = require("express");
const router = express.Router()

const cate_handler = require("../router_handler/cate")

const {add_cate_schema,delete_cate_schema,get_cate_schema,update_cate_schema} = require("../schema/cate")
const expressJoi = require("@escook/express-joi")


// 获取分类信息路由
router.get("/cates",cate_handler.getArticleCate)

// 新增分类信息路由
router.post("/addcate",expressJoi(add_cate_schema),cate_handler.addArticleCate)

// 删除分类信息中由
router.get("/deletecate/:id",expressJoi(delete_cate_schema),cate_handler.deleteArticleCate)

// 根据id获取文章分类路由
router.get("/cates/:id",expressJoi(get_cate_schema),cate_handler.getArticleCateById)

// 根据id更新文章分类路由
router.post("/updatecate",expressJoi(update_cate_schema),cate_handler.updateArticleCateById)

module.exports = router
